package com.github.caijinglong

import com.github.caijinglong.ext.println
import org.json.JSONArray
import org.json.JSONObject

val relicsJson = """["Calling Bell","Dodecahedron","Tiny Chest","Bag of Preparation","White Beast Statue","Meat on the Bone","Matryoshka","Black Star","Sozu","Tiny House","Darkstone Periapt","Lantern","Bottled Flame","Oddly Smooth Stone","Blood Vial","Pantograph","Centennial Puzzle","Mercury Hourglass","Self Forming Clay","Gremlin Horn","Juzu Bracelet","Strawberry","Ectoplasm","Letter Opener","Champion Belt","Bag of Marbles","Vajra","Necronomicon","Bottled Lightning","Red Skull","Frozen Eye","Kunai","Astrolabe","Orichalcum","Mummified Hand","Ornamental Fan","Pear","Toolbox","Magic Flower","Happy Flower","Anchor"]"""

fun main(args: Array<String>) {
    val jsonArray = JSONArray(relicsJson)
    val li = ArrayList<String>()
    jsonArray.toMutableList().forEach {
        li.add(it.toString())
    }
    li.sort()
    JSONArray(li).println()
}

class RelicsPutter(val jsonObject: JSONObject) {

    fun putRelics() {
        jsonObject.put("relics", relicsJson)
    }

}